package org.android.application.marksixmanage.model;

import java.util.ArrayList;
import java.util.List;

public enum LotteryPlatform {

	Lottery_SiX(1, "六合彩");

	private LotteryPlatform(int platformId, String lotteryName) {
		this.platformId = platformId;
		this.lotteryName = lotteryName;
	}

	private int platformId;
	private String lotteryName;

	public int getPlatformId() {
		return platformId;
	}

	public void setPlatformId(int platformId) {
		this.platformId = platformId;
	}

	public String getLotteryName() {
		return lotteryName;
	}

	public void setLotteryName(String lotteryName) {
		this.lotteryName = lotteryName;
	}
	
	public static List<String> getLotteryItems(){
		LotteryPlatform[] platforms = LotteryPlatform.values();
		List<String> lotteryItems = new ArrayList<String>();
		for(LotteryPlatform platform:platforms){
			lotteryItems.add(platform.getLotteryName());
		}
		return lotteryItems;
	}
	
	public static LotteryPlatform getLotteryPlatformByName(String platformName){
		for(LotteryPlatform platform:LotteryPlatform.values()){
			if(platform.getLotteryName().equals(platformName)){
				return platform;
			}
		}
		return null;
	}
	
	public static LotteryPlatform getLotteryPlatformById(int platformId){
		for(LotteryPlatform platform:LotteryPlatform.values()){
			if(platform.getPlatformId()==platformId){
				return platform;
			}
		}
		return null;
	}
	
}
